# !/usr/bin/env python
# -*-coding:utf-8 -*-
"""
@Author : Ayao
@Time   : 2022/5/10
@File   : 数组拆分 I.py
"""
from typing import List

nums = [6, 2, 6, 5, 1, 2]


class Solution:
    def arrayPairSum(self, nums: List[int]) -> int:
        nums.sort()
        return sum(nums[::2])


print(Solution().arrayPairSum([6, 2, 6, 5, 1, 2]))
print(Solution().arrayPairSum([1, 4, 3, 2]))
